{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "caroline-cologne",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Channel</th>\n",
       "      <th>Region</th>\n",
       "      <th>Fresh</th>\n",
       "      <th>Milk</th>\n",
       "      <th>Grocery</th>\n",
       "      <th>Frozen</th>\n",
       "      <th>Detergents_Paper</th>\n",
       "      <th>Delicassen</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>12669</td>\n",
       "      <td>9656</td>\n",
       "      <td>7561</td>\n",
       "      <td>214</td>\n",
       "      <td>2674</td>\n",
       "      <td>1338</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>7057</td>\n",
       "      <td>9810</td>\n",
       "      <td>9568</td>\n",
       "      <td>1762</td>\n",
       "      <td>3293</td>\n",
       "      <td>1776</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>6353</td>\n",
       "      <td>8808</td>\n",
       "      <td>7684</td>\n",
       "      <td>2405</td>\n",
       "      <td>3516</td>\n",
       "      <td>7844</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>13265</td>\n",
       "      <td>1196</td>\n",
       "      <td>4221</td>\n",
       "      <td>6404</td>\n",
       "      <td>507</td>\n",
       "      <td>1788</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>22615</td>\n",
       "      <td>5410</td>\n",
       "      <td>7198</td>\n",
       "      <td>3915</td>\n",
       "      <td>1777</td>\n",
       "      <td>5185</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Channel  Region  Fresh  Milk  Grocery  Frozen  Detergents_Paper  Delicassen\n",
       "0        2       3  12669  9656     7561     214              2674        1338\n",
       "1        2       3   7057  9810     9568    1762              3293        1776\n",
       "2        2       3   6353  8808     7684    2405              3516        7844\n",
       "3        1       3  13265  1196     4221    6404               507        1788\n",
       "4        2       3  22615  5410     7198    3915              1777        5185"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np \n",
    "import pandas as pd \n",
    "import matplotlib as mpl \n",
    "import matplotlib.pyplot as plt \n",
    "%matplotlib inline \n",
    "from sklearn.datasets import load_iris\n",
    "# 请补全代码（10分）\n",
    "#导入数据集 \n",
    "data = pd.read_csv('./Wholesale customers data.csv')\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "sufficient-techno",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Channel             440\n",
       "Region              440\n",
       "Fresh               440\n",
       "Milk                440\n",
       "Grocery             440\n",
       "Frozen              440\n",
       "Detergents_Paper    440\n",
       "Delicassen          440\n",
       "dtype: int64"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#查看数据缺失值---数据并没有缺失值，数据完整性比较好\n",
    "#请补全代码（5分）\n",
    "data.count(axis=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "racial-chapter",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Channel</th>\n",
       "      <th>Region</th>\n",
       "      <th>Fresh</th>\n",
       "      <th>Milk</th>\n",
       "      <th>Grocery</th>\n",
       "      <th>Frozen</th>\n",
       "      <th>Detergents_Paper</th>\n",
       "      <th>Delicassen</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "      <td>440.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>1.322727</td>\n",
       "      <td>2.543182</td>\n",
       "      <td>12000.297727</td>\n",
       "      <td>5796.265909</td>\n",
       "      <td>7951.277273</td>\n",
       "      <td>3071.931818</td>\n",
       "      <td>2881.493182</td>\n",
       "      <td>1524.870455</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>0.468052</td>\n",
       "      <td>0.774272</td>\n",
       "      <td>12647.328865</td>\n",
       "      <td>7380.377175</td>\n",
       "      <td>9503.162829</td>\n",
       "      <td>4854.673333</td>\n",
       "      <td>4767.854448</td>\n",
       "      <td>2820.105937</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>55.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>25.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>3.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>2.000000</td>\n",
       "      <td>3127.750000</td>\n",
       "      <td>1533.000000</td>\n",
       "      <td>2153.000000</td>\n",
       "      <td>742.250000</td>\n",
       "      <td>256.750000</td>\n",
       "      <td>408.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>1.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>8504.000000</td>\n",
       "      <td>3627.000000</td>\n",
       "      <td>4755.500000</td>\n",
       "      <td>1526.000000</td>\n",
       "      <td>816.500000</td>\n",
       "      <td>965.500000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>2.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>16933.750000</td>\n",
       "      <td>7190.250000</td>\n",
       "      <td>10655.750000</td>\n",
       "      <td>3554.250000</td>\n",
       "      <td>3922.000000</td>\n",
       "      <td>1820.250000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>2.000000</td>\n",
       "      <td>3.000000</td>\n",
       "      <td>112151.000000</td>\n",
       "      <td>73498.000000</td>\n",
       "      <td>92780.000000</td>\n",
       "      <td>60869.000000</td>\n",
       "      <td>40827.000000</td>\n",
       "      <td>47943.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          Channel      Region          Fresh          Milk       Grocery  \\\n",
       "count  440.000000  440.000000     440.000000    440.000000    440.000000   \n",
       "mean     1.322727    2.543182   12000.297727   5796.265909   7951.277273   \n",
       "std      0.468052    0.774272   12647.328865   7380.377175   9503.162829   \n",
       "min      1.000000    1.000000       3.000000     55.000000      3.000000   \n",
       "25%      1.000000    2.000000    3127.750000   1533.000000   2153.000000   \n",
       "50%      1.000000    3.000000    8504.000000   3627.000000   4755.500000   \n",
       "75%      2.000000    3.000000   16933.750000   7190.250000  10655.750000   \n",
       "max      2.000000    3.000000  112151.000000  73498.000000  92780.000000   \n",
       "\n",
       "             Frozen  Detergents_Paper    Delicassen  \n",
       "count    440.000000        440.000000    440.000000  \n",
       "mean    3071.931818       2881.493182   1524.870455  \n",
       "std     4854.673333       4767.854448   2820.105937  \n",
       "min       25.000000          3.000000      3.000000  \n",
       "25%      742.250000        256.750000    408.250000  \n",
       "50%     1526.000000        816.500000    965.500000  \n",
       "75%     3554.250000       3922.000000   1820.250000  \n",
       "max    60869.000000      40827.000000  47943.000000  "
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.describe(include='all')#请补全代码（5分）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "id": "adjustable-graphics",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.70833271, 0.53987376, 0.42274083, 0.01196489, 0.14950522,\n",
       "        0.07480852],\n",
       "       [0.44219826, 0.61470384, 0.59953989, 0.11040858, 0.20634248,\n",
       "        0.11128583],\n",
       "       [0.39655169, 0.5497918 , 0.47963217, 0.15011913, 0.2194673 ,\n",
       "        0.48961931],\n",
       "       ...,\n",
       "       [0.36446153, 0.38846468, 0.7585445 , 0.01096068, 0.37223685,\n",
       "        0.04682745],\n",
       "       [0.93773743, 0.1805304 , 0.20340427, 0.09459392, 0.01531   ,\n",
       "        0.19365326],\n",
       "       [0.67229603, 0.40960124, 0.60547651, 0.01567967, 0.11506466,\n",
       "        0.01254374]])"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#在此使用Normalizer---使用方法同MinMaxScaler、StandardScaler\n",
    "#请补全代码（10分\n",
    "from sklearn.preprocessing import Normalizer\n",
    "normalizer=Normalizer()\n",
    "X = normalizer.transform(data.iloc[:,2:])\n",
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "italic-banana",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.cluster import KMeans \n",
    "n_clusters = 3 \n",
    "cluster = KMeans(n_clusters=n_clusters, random_state=0).fit(X) \n",
    "y_pred = cluster.labels_ "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "id": "answering-eligibility",
   "metadata": {
    "code_folding": [
     6
    ]
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.lines.Line2D at 0x1b5a3b3dda0>"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO3deXxU9b3/8ddnJhtZSICEBBKQVSRhEQgB11oFoS51KRXcQFEQ19bbq7W9v9rbzda219p63RAQEBEVl7pQUatW7ZUlYQ+bgCwJAmELO9k+vz9mwBgGMiGZnJkzn+fj4aPJzPec88lpfHvyne/5HFFVjDHGuJfH6QKMMcaElgW9Mca4nAW9Mca4nAW9Mca4nAW9Mca4XIzTBQSSnp6unTp1croMY4yJGEVFRTtVNSPQe2EZ9J06daKwsLDB223dexiA9mktmrokY4wJayKy6WTvhWXQn677X14CwMt3nONwJcYYEz5cFfT3Xtzd6RKMMSbsuCroz++e7nQJxhgTdly16mbzrkNs3nXI6TKMMSasuOqK/oHZSwGbozfGmNqCuqIXkeEiskZE1onIQwHev0hEykVkif+fh4PdtindP/RM7h96ZigPYYwxEafeK3oR8QJPAkOBEmChiLylqivrDP1MVa84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F9EikRkfID3nTpn9dUFzX/Ogunq26TnK6KDXkSSgdeAH6vqvrpvB9ikWa4W66lrEXCGqvYFngDebI6aVLVaVc/G15SuQER61RniyPkKoq5mPV8icgWwQ1WLTjUswGshPVdB1uXI75bfearaH/gecLeIXFjnfaf+fayvLifOWTBdfZv0fEVs0ItILL4wfVFVXw8wpEFdN5urLlXdd2y6Qn2tJWLF1+mzWfj/RPwEGF7nLUfO1zEnq8uB83Ue8H0R2QjMAi4WkRl1xjhxruqty8nfLVXd6v/fHcAb+B5YVJsjv1/11eXQOQumq2+Tnq+IDHoREXzzW6tU9bGTDHsLX6M1EZHBQLmqfu10XSKS5R+HiBTg+/9gV4jryhCRNP/XLYAhwOo6w5w4X/XW1dznS1V/pqo5qtoJX6fWj1T1pjrDmv1cBVOXE79b/mMliUjKsa+BS4EVdYY58ftVb11OnDNV3QZsEZEe/pcCdfVt0vMVVFOzMHQecDOw3D+/C/BzoCMcb7g2B98n1+uAQwTRNbOZ6hoB3CkiVfg6fY5S/8fsIdQOmCa+5/96gFdU9R35dgdSJ85XMHU5cb5OEAbnKpi6nDpXmcAb/ryMAWaq6nthcM6Cqcupc3ZCV99Qni9rgWCMMS4XkVM3xhhjgmdBb4wxLmdBb4wxLmdBb4wxLmdBb4wxLmdBb4wxLmdBb4wxLvf/AXKj1MW3+ijRAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "from sklearn.cluster import KMeans \n",
    "from sklearn.metrics import silhouette_score #轮廓系数\n",
    "#请补全代码（25分）\n",
    "import pandas as pd \n",
    "score=[] \n",
    "#将k值从2变化到6\n",
    "for i in range(2,7):\n",
    "    cluster= KMeans(n_clusters=i, random_state=0).fit(X) \n",
    "    score.append(silhouette_score(X,cluster.labels_))\n",
    "plt.plot(range(2,7),score) \n",
    "plt.axvline(pd.DataFrame(score).idxmax()[0]+2,ls=':')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "id": "civilian-eight",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Fresh</th>\n",
       "      <th>Milk</th>\n",
       "      <th>Grocery</th>\n",
       "      <th>Frozen</th>\n",
       "      <th>Detergents_Paper</th>\n",
       "      <th>Delicassen</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>cl</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.262553</td>\n",
       "      <td>0.488689</td>\n",
       "      <td>0.677848</td>\n",
       "      <td>0.095956</td>\n",
       "      <td>0.266153</td>\n",
       "      <td>0.100561</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.907702</td>\n",
       "      <td>0.171099</td>\n",
       "      <td>0.226181</td>\n",
       "      <td>0.150525</td>\n",
       "      <td>0.049222</td>\n",
       "      <td>0.071186</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.575088</td>\n",
       "      <td>0.233245</td>\n",
       "      <td>0.279252</td>\n",
       "      <td>0.625425</td>\n",
       "      <td>0.053748</td>\n",
       "      <td>0.109052</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Fresh      Milk   Grocery    Frozen  Detergents_Paper  Delicassen\n",
       "cl                                                                      \n",
       "0   0.262553  0.488689  0.677848  0.095956          0.266153    0.100561\n",
       "1   0.907702  0.171099  0.226181  0.150525          0.049222    0.071186\n",
       "2   0.575088  0.233245  0.279252  0.625425          0.053748    0.109052"
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#建模分类（3类）\n",
    "#请补全代码（25分）\n",
    "from sklearn.cluster import KMeans \n",
    "n_clusters = 3 \n",
    "cluster = KMeans(n_clusters=n_clusters, random_state=0).fit(X) \n",
    "y_pred = cluster.labels_ \n",
    "\n",
    "df = pd.DataFrame(X,columns=data.columns[2:])\n",
    "df['cl'] = cluster.labels_\n",
    "df_p = df.groupby('cl').mean()\n",
    "df_p"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "id": "graduate-guide",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "cl\n",
       "0    177\n",
       "1    210\n",
       "2     53\n",
       "Name: Fresh, dtype: int64"
      ]
     },
     "execution_count": 71,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_c = df.groupby('cl')['Fresh'].count()\n",
    "df_c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "id": "diverse-wisdom",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x1b5a3a7c2b0>"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAOcAAADnCAYAAADl9EEgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO3deXxU1f3/8deZJZMQ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I/rCcDfYheYPcAGw54rAc+R/NVRWn/SgtUOM3KOGfthXGueqLiDcQAAADHSURBVOijB5B8wMPR/NZ6yFYagRqgCiOAZUA5UApsYl8YVacAU1LhjCea04YRVBtQh+bzS65I6QAVTkUxKdXxXVFMSoVTUUxKhVNRTEqFU1FMSoVTUUxKhVNRTEqFU1FMSoVTUUxKhVNRTEqFU1FMSoVTUUxKhVNRTEqFU1FMSoVTUUxKhVNRTEqFU1FMSoVTUUxKhVNRTEqFU1FMSoVTUUxKhVNRTEqFU1FMSoVTUUxKhVNRTEqFU1FMSoVTUUxKhVNRTOr/AGSx4PhBaf/UAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#绘制饼状图\n",
    "#请补全代码（10分）\n",
    "import matplotlib.pyplot as plt\n",
    "labels=['0','1','2']\n",
    "X=df_c\n",
    "plt.pie(X,labels=labels,autopct='%1.2f%%') #画饼图（数据，数据对应的标签，百分数保留两位小数点）\n",
    "plt.legend()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "id": "remarkable-electricity",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x1b5a6013198>"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAcKElEQVR4nO3de3RU5fn28e/NkMhJgQTUQlTCKtUCOZgEUDl4YBEixaDUtJx8gUoDCopQqPjqQqXYWovVKpY0Wn7UikIVpC7BV0CKR0RAYySAgBRLGpcctFSQKC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A71GGshp/kzo58FjzsSMuCjUgXAC3YLsc6cwBudcIVBLN4zIMrONzrmshvp8Evv0MyE1ee3nIZwpl1LgghrbSUDZKYwREZF6FE6gbwC6mFmymcUDw4CXAsa8BPyf6tUulwEHnXOfBZ5IRETqT51TLs65CjObBLwK+ID5zrkSM5tQfbwAWAEMAnYCXwNj66/kk9Jg0ztyxtDPhNTkqZ8Hc+47U90iInIG0p2iIiIeoUAXEfEIzwZ6Xe0KpHExs/lmttfMNke7Fok+M7vAzP5hZlvNrMTMJke7pkjw5Bx6dbuC7cAAqpZUbgCGO+e2RLUwiRoz6wccouqO5u7Rrkeiq/pO9u855943s7OBTcD1Z3pGePUKPZx2BdKIOOfeAL6Idh0SG5xznznn3q/++CtgK1V3t5/RvBrooVoRiIicwMw6AZcC66NbyenzaqCH1YpARBo3M2sFLAHucM79N9r1nC6vBrpaEYhIrcwsjqowX+icWxrteiLBq4EeTrsCEWmkzMyAPwNbnXO/j3Y9keLJQHfOVQDH2xVsBf7mnCuJblUSTWb2HLAOuNjMSs3s5mjXJFHVG7gJuMbMiqr/DIp2UafLk8sWRUQaI09eoYuINEYKdBERj1Cgi4h4hAJdRMQjFOgiIh6hQBcR8QgFuoiIR/x/GLvAyhUM7oQAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#绘制条形图\n",
    "#请补全代码（10分）\n",
    "fig, ax = plt.subplots()\n",
    "n_groups = 3\n",
    "index = np.arange(n_groups)\n",
    "bar_width = 0.05\n",
    " \n",
    "opacity = 0.4\n",
    "error_config = {'ecolor': '0.3'}\n",
    " \n",
    "\n",
    "rects1 = ax.bar(index, df_p.iloc[:,0], bar_width,\n",
    "                alpha=opacity, color='b',\n",
    "                error_kw=error_config,\n",
    "                label=df.columns[0])\n",
    " \n",
    "rects2 = ax.bar(index + bar_width, df_p.iloc[:,1], bar_width,\n",
    "                alpha=opacity, color='m',\n",
    "                error_kw=error_config,\n",
    "                label=df.columns[1])\n",
    " \n",
    "rects3 = ax.bar(index + bar_width*2, df_p.iloc[:,2], bar_width,\n",
    "                alpha=opacity, color='r',\n",
    "                error_kw=error_config,\n",
    "                label=df.columns[2])\n",
    "rects4 = ax.bar(index + bar_width*3,df_p.iloc[:,3], bar_width,\n",
    "                alpha=opacity, color='g',\n",
    "                error_kw=error_config,\n",
    "                label=df.columns[3])\n",
    "rects5 = ax.bar(index + bar_width*4, df_p.iloc[:,4], bar_width,\n",
    "                alpha=opacity, color='b',\n",
    "                error_kw=error_config,\n",
    "                label=df.columns[4])\n",
    "rects6 = ax.bar(index + bar_width*5, df_p.iloc[:,5], bar_width,\n",
    "                alpha=opacity, color='y',\n",
    "                error_kw=error_config,\n",
    "                label=df.columns[5])\n",
    " \n",
    "ax.set_xticks(index + 3 * bar_width / 3)\n",
    "ax.set_xticklabels(('0', '1', '2'))\n",
    "ax.legend()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "swedish-powder",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
